<!DOCTYPE html>
<html>
<head>
    <include file="Public:head"/>
</head>
<body>
<div class="page-group">
    <div class="page page-current">
        <div class="content">
            <div class="list-block">
                <div style="text-align: center;margin-bottom: 1rem;">
                    <img src="/admin/img/avatars/logo.png" style="height: 10rem;">
                </div>
                <ul>
                    <!-- Text inputs -->
                    <li>
                        <div class="item-content">
                            <div class="item-media"><i class="icon icon-form-name"></i></div>
                            <div class="item-inner">
                                <div class="item-title label">账号</div>
                                <div class="item-input">
                                    <input type="text" name="account" placeholder="Your account">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="item-content">
                            <div class="item-media"><i class="icon icon-form-password"></i></div>
                            <div class="item-inner">
                                <div class="item-title label">密码</div>
                                <div class="item-input">
                                    <input type="password" name="password" placeholder="Password" class="">
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="content-block">
                <a href="#" class="button button-big button-fill button-default" id="handleLogin">提交</a>
            </div>
        </div>
    </div>
</div>
<include file="Public:js"/>
<script>
    $('#handleLogin').on('click', function () {
        $.showPreloader('登录中');
        $.post("{:U('handleLogin')}",
                {
                    account: $('[name="account"]').val(),
                    password: $('[name="password"]').val()
                },
                function (data, status) {
                    $.hidePreloader();
                    data = $.parseJSON(data);
                    if (data.code == 1) {
                        window.location.href = "{:U('Index/index')}";
//                        $.router.load("#index-index");
                    } else {
                        $.alert(data.msg);
                    }
                });
    });
</script>
</body>
</html>